package com.jt.controller;

import com.jt.pojo.User;
import com.jt.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @outhor fufeixiang
 * @date 2021-05-11
 */
@RestController
@CrossOrigin
public class AxiosUserController {
    @Autowired
    private UserService userService;

    @GetMapping("/findAll")
    public List<User> findAll(){

        return  userService.findAll();
    }
    @PutMapping("/updateUser")
    public void updateUser(@RequestBody User user){
        userService.updateUser(user);
    }
    @DeleteMapping("/deleteUser")
    public void deleteUser(Integer id){
        userService.deleteUser(id);
    }
}
